/**
 * Created by Administrator on 2017/3/21.
 */
var key = getCookie('key');
var mid = '';
if (!key) {
    window.location.href = WapSiteUrl + '/tmpl/member/login.html';
} else {
    $.ajax({
        type: 'post',
        url: ApiUrl + "/index.php?act=member_promotion",
        data: {key: key},
        dataType: 'json',
        success: function (result) {
            data = result['datas'];
            mid = data['member_id'];
            var header_html = '<div class="header_info_touxiang">';
            if (data['member_avatar']) {
                header_html += '<img src="/data/upload/shop/avatar/' + data['member_avatar'] + '" alt="">';
            } else {
                header_html += '<img src="../../images/default_user_portrait.gif" alt="">'
            }
            header_html += '</div><div class="header_info_name"><p>' + data['member_name'] + '<span>&nbsp;</span></p><p style="padding-top: 7px">加入时间:<time>' + data['member_time'] + '</time></p></div>';
            document.getElementById('header_info').innerHTML = header_html;
            var fenyong_html = '<div class="feiyong_info"><p>累计推广费用</p><p>' + data['brokerage'] + 'V币</p></div><div class="feiyong_info"><p>可提现推广费用</p><p>' + data['av_brokerage'] + 'V币</p></div>';
            document.getElementById('fenyong').innerHTML = fenyong_html;
        }
    });
}

// 分享二维码
function share(){

      window.location.href = 'erweima.html?mid='+mid;
    
}